const router = require('koa-router')()
router.prefix('/'); //路由前缀 /user/xxx访问
router.get('/', async (ctx, next) => {
  await ctx.render('index', {
    title: 'koa-mvc'
  });
})

router.get('/string', async (ctx, next) => {
  ctx.body = 'koa2 string'
})

router.get('/json', async (ctx, next) => {
  ctx.body = "<div style='color:red'>hello</div>"
})

module.exports = router
